package com.ts.api.common.entity;

import com.gitee.apanlh.util.base.StringUtils;
import lombok.Data;

/**
 *  字符串格式化类
 *
 *  @author Pan
 */
@Data
public class MsgFormat {

    /** 状态 */
    private Integer code;
    /** 消息 */
    private String msg;

    public MsgFormat() {
        super();
    }

    public MsgFormat(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static MsgFormat create(Integer code, String msg) {
        return new MsgFormat(code, msg);
    }

    public static MsgFormat createFormat(Integer code, String msg, Object... objects) {
        return new MsgFormat(code, StringUtils.format(msg, objects));
    }

}
